﻿namespace Sidvall.AuthorizationManager.Model.Local.DataPortalManagers
{
    public static partial class AuthorizationScopeUserManager
    {
        static partial void OnBeforeSaveItem(IDataPortalManager dataPortalManager, Sidvall.Business.DataPortalContext<Data.IAuthorizationScopeUser, Sidvall.Data.SaveContext<Data.IAuthorizationScopeUser>> dataPortalContext)
        {
            if (dataPortalContext.DataRowStateIsDirty() == true)
            {
                dataPortalContext.OperationContext.Item.UpdatedTime = System.DateTime.UtcNow;
            }
        }

        static partial void OnBeforeSaveItems(IDataPortalManager dataPortalManager, Sidvall.Business.DataPortalContext<Data.IAuthorizationScopeUser, Sidvall.Data.SaveContext<Sidvall.Data.IDataRowProvider<Data.IAuthorizationScopeUser>>> dataPortalContext)
        {
            foreach (var item in dataPortalContext.OperationContext.Item.DataItems)
            {
                if (dataPortalContext.DataRowStateIsDirty(item) == true)
                {
                    item.UpdatedTime = System.DateTime.UtcNow;
                }
            }
        }
    }
}